<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglib.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>版本列表</title>
	<link rel="stylesheet" href="${ctx }/static/css/Master.css"/>
	<link rel="stylesheet" href="${ctx }/static/css/lq.datetimepick.css"/>
	
	<script type="text/javascript" src="${ctx }/static/js/jquery-1.9.0.min.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/simpletooltip.min.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/Common.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/jsScroller.js"></script>
	<script type="text/javascript" src="${ctx }/static/js/jsScrollbar.js"></script>
	<script type="text/javascript" src="${ctx}/static/js/layer.js"></script>
	<style type="text/css">
		#content{ width:100%; background:#525252; position:absolute; left:0; top:0px; bottom:1px;}
		#main_right {
		  margin: 0px;
		  height: 100%;
		  overflow: auto;
		  border-top: 1px solid #717171;
		  background: #fff;
		}
	</style>
	<script type="text/javascript">
		function isDisabled(verId,normal)
		{
			var msg = '确认'+(normal==1?'禁用':'启用')+'吗?';
			top.layer.confirm(msg, {icon: 3}, function(index){
				$.ajax({    
				    url:"${ctx}/appManager/updateAppVersion.do",   
				    data:{"verId":verId,"normal":(normal==1?0:1)},    
				    type:"post",    
				    cache:false,    
				    dataType:"json",
				    async:true, //默认为true 异步    
				    success:function(data) {
			            top.layer.msg("操作成功!!",{},function(){
				        	window.location.reload();   
			            });
				     },    
				     error : function(XMLHttpRequest, textStatus, errorThrown) {
				         top.layer.alert(XMLHttpRequest.responseText);
			  		 }   
				});
			});
		}
	</script>
  </head>
  
  <body>
	<div class="wrapper">
		<section id="content">
			<section id="main_right">
				<section class="boxRight">
					<div class="context boxborder">
						<div class="pr prlink"><a href="${ctx }/appManager/addAppVersion.do"><span class="icon j_icon"></span>新增版本</a></div>
						<div class="com_table">
							<table width="100%" cellpadding="0" cellspacing="0">
								<tr>
									<th>序号</th>
									<th>操作平台</th>
									<th>版本号</th>
									<th>链接地址</th>
									<th>发布时间</th>
									<th>版本说明</th>
									<th>下载量</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
								<c:forEach var="ver" items="${result.entityList}" varStatus="verIndex" >
								<tr>
									<td>${verIndex.index + 1 }</td>
									<td>${diy:keyToValue(ver.verOs,'SET_VERSION')}</td>
									<td>${ver.verVersion }</td>
									<td>${ver.verDownurl }</td>
									<td>${ver.verReleaseTime }</td>
									<td>${ver.verDepict }</td>
									<td>${ver.dowCount }</td>
									<td>${diy:keyToValue(ver.normal,'NORMAL')}</td>
									<td><a class="icon micon_2" title="编辑" href="${ctx }/appManager/findAppVersion.do?verId=${ver.verId}"></a>
									<a class="icon micon_${org.normal == 1? 1 : 12}" title="${ver.normal == 1? '停用' : '启用'}" href="javascript:isDisabled('${ver.verId}','${ver.normal}');"></a><a class="icon micon_17" title="统计/日志" href="javascript:void(0);"></a></td>
								</tr>
								</c:forEach>
							</table>
						</div>
					</div>
				
			</section>
			</section>
		<!--/左边-->
		</section>
	</div>
  </body>
</html>
